# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=lfifreak
pkgver=21.0c6adef
pkgrel=4
groups=('blackarch' 'blackarch-webapp' 'blackarch-exploitation')
pkgdesc='A unique automated LFi Exploiter with Bind/Reverse Shells.'
arch=('any')
url='https://github.com/OsandaMalith/LFiFreak/'
license=('custom:unknown')
depends=('python2' 'python2-beautifulsoup4')
makedepends=('git')
source=("$pkgname::git+https://github.com/OsandaMalith/LFiFreak.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/env python2' lfi.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 lfi.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md \
    binaries/Download.txt
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

